<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/common.jsp"%>
<%@ page import="com.chanyachting.emall.util.*" %>
<%@ page import="java.util.*" %>

<%@ page import="com.chanyachting.emall.domain.*" %>
<%@ page import="com.chanyachting.emall.util.RequestUtil" %>
<%@ page import="com.chanyachting.emall.service.*" %>
<%@ page import="com.chanyachting.emall.serviceImpl.*" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" /> 
<meta name="description" content="" />
<link href="css/import.css" type="text/css" rel="stylesheet" />
<title>频道列表</title>


<%
	//如果有，获得上级频道对象
	RequestUtil ru=new RequestUtil(request);

	Channel pchannel=(Channel)ru.getAttribute("pchannel",new Channel());

%>

</head>

<body>
<div class="tab_box">
	<div class="tab_menu">
    	<a href="#" class="current">频道列表</a>
    </div>
	
</div>



<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="yes_border">
 
  <tr>
    <td colspan="9" align="center" bgcolor="#E7E7E7"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="no_border">
      <tr>
        <td width="15%" align="center"></td>
        <td align="center"><%= pchannel.getId()!=null?"上级频道："+pchannel.getName():"&nbsp;" %></td>
        <td width="15%" align="center"></td>
      </tr>
    </table></td>
  </tr>
  
  
  <tr>
    <th  align="center">编号</th>
    <th  align="center">频道名称</th>
    <th  align="center"><p>状态</p></th>
    <th  align="center">频道类型</th>
    <th  align="center">可加入产品类型</th>
    <th  align="center">优先级</th>
    <th  align="center">创建日期</th>
     <th align="center">操作</th>
  </tr>
  
  <%
  
  
  	List list=(List)new RequestUtil(request).getAttribute("channelList",new ArrayList());
  
  	Channel  channel=null;
  
  	if(list!=null && list.size()>0){
  		
  		
  		for(int i=0;i<list.size();i++){
  			
  			channel=(Channel)list.get(i);
  %>
  <tr>
  <form name="<%=i %>" action="" method="post">
  
    <td align="center"><%= channel.getId() %></td>
    <td align="center"><%=channel.getName() %></td>
    <td align="center"><%=channel.getStatus().equals("00")?"不公开":"公开" %></td>
    <td align="center"><%= CodeMap.channelType.get(channel.getType()).toString()  %></td>
    <td align="center"><%= CodeMap.companyProductType.get(channel.getProductType()).toString()  %></td>
    <td align="center"><%=channel.getPri() %></td>
    <td align="center"><%=channel.getCreateDate() %></td>
    
    <td align="center">
    	<%
    		//判断是否是二级频道，如果是，不显示下级频道链接
    		if(channel.getParentChannelId()==0){
    			
    	%>
    	<a href="<%=root %>/adminBackend/channel.do?method=subList&pid=<%=channel.getId() %>">下级频道列表</a>&nbsp;&nbsp;&nbsp;
    	<%		
    		}
    	%>
    	<a href="<%=root %>/adminBackend/channel.do?method=update&id=<%=channel.getId() %>">修改</a>
    	<a href="<%=root %>/adminBackend/channel.do?method=delete&id=<%=channel.getId() %>" onclick="return confirm('确认删除？');">删除</a>
    </td>
   </form>
  </tr>
  
  <%
  			
  		}

  	}
  
  %>
  
 
 
  <tr>
    <td colspan="9" bgcolor="#E7E7E7"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="no_border">
      <tr>
        <td width="15%" align="center"></td>
        <td align="center">&nbsp;</td>
        <td width="15%" align="center"></td>
      </tr>
    </table></td>
  </tr>
 
</table>
<p>&nbsp;</p>
</body>
</html>

